import { request } from '@gui-pkg/request';

enum Api {
  PanoramaList = '/api/gq/onemap/findPanoramaList',
  Panorama = '/api/gq/onemap/saveOrUpdatePanorama',
}

const requestOptions = {
  isTransformResponse: false,
};

// 查询所有全景图列表
export const getPanoramaList = (params) => {
  return request.get({ url: Api.PanoramaList, params });
};

// 保存或修改全景图
export function saveOrUpdatePanorama(params) {
  return request.post({ url: Api.Panorama, params }, requestOptions);
}

// 删除全景图信息
export const deletePanorama = (id) => {
  return request.post({ url: `/api/gq/onemap/deletePanorama/${id}` }, requestOptions);
};

/**
 * @description: 上传图片
 */
export const addImgageUpload = (params) => {
  const globPathname = window.localStorage.getItem("GlobPathname");
  return request.uploadFile({ url: globPathname + '/xyhgq/api/gq/minio/upload'}, params);
};
